<template>
  <div style="background-color: #f5f6fa">
    <BDhear :num="4"></BDhear>
    <div class="main">
      <el-row :gutter="15">
        <!-- 投标保函 -->
        <el-form
          ref="elForm"
          v-if="nametype == '投标保函'"
          :model="content"
          :rules="rules"
          size="medium"
          label-width="100px"
        >
          <el-col :span="12">
            <el-form-item label="保函编号" prop="apply_number">
              <el-input
                :disabled="content.apply_number"
                v-model="content.apply_number"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函金额" prop="bhje">
                <!-- :disabled="content.xmbh" -->
              <el-input
              
                v-model="content.bhje"
                placeholder="请输入保函金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>



          <el-col :span="12">
            <el-form-item label="保证金额" prop="margin_amount">
              <el-input
                v-model="content.bzjje"
                placeholder="请输入保证金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="申请人" prop="handler_name">
              <el-input
                v-model="content.sqr"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="受益人" prop="syr">
              <el-input
                v-model="content.syr"
                placeholder="请输入受益人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
                 <el-col :span="12">
            <el-form-item label="招标人" prop="zbr">
              <el-input
                v-model="content.zbr"
                placeholder="请输入招标人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
                 <el-col :span="12">
            <el-form-item label="投标人" prop="tbr">
              <el-input
                v-model="content.tbr"
                placeholder="请输入投标人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        <el-col :span="12">
            <el-form-item label="项目名称" prop="xmmc">
              <el-input
                :disabled="content.xmmc"
                v-model="content.xmmc"
                placeholder="请输入项目名称"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
      <el-col :span="12">
            <el-form-item label="项目编号" prop="xmbh">
              <!-- :disabled="content.xmbh" -->
              <el-input
               
                v-model="content.xmbh"
                placeholder="请输入项目编号"
          
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
    <el-col :span="12">
            <el-form-item label="保证金金额" prop="bzjje">
              <el-input
                v-model="content.bzjje"
                placeholder="请输入保证金金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="起始时间" prop="startTime">
              <!-- <el-input v-model="content.startTime" placeholder="请输入起始时间" clearable :style="{width: '100%'}">
              </el-input>-->
              <el-date-picker
                v-model="content.startTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="截止时间" prop="endTime">
              <el-date-picker
                v-model="content.startTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
   
          <el-col :span="12">
            <el-form-item label="担保期限" prop="dbqx">
              <el-input
                v-model="content.dbqx"
                placeholder="请输入担保期限"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
   
          <el-col :span="12">
            <el-form-item label="费率" prop="apply_zhekou">
              <el-input
                v-model="content.fl"
                placeholder="请输入费率"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
  
          <el-col :span="12">
            <el-form-item label="保费金额" prop="bfje">
              <el-input
                v-model="content.bfje"
                placeholder="请输入保费金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-form>
        <!-- 业主保函 -->
        <el-form
          ref="elForm"
          v-if="nametype == '业主支付保函'"
          :model="yz_content"
          :rules="rules"
          size="medium"
          label-width="100px"
        >
          <el-col :span="12">
            <el-form-item label="保函编号" prop="bhbh">
              <el-input
                v-model="yz_content.bhbh"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函金额" prop="bhje">
              <el-input
                v-model="yz_content.bhje"
                placeholder="请输入保函金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="乙方(承包商)" prop="yf">
              <el-input
                v-model="yz_content.yf"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="甲方" prop="jf">
              <el-input
                v-model="yz_content.jf"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同签订日期" prop="htqd">
              <el-date-picker
                v-model="yz_content.htqd"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同编号" prop="htbh">
              <el-input
                v-model="yz_content.htbh"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生效时间" prop="startTime">
              <el-date-picker
                v-model="yz_content.startTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="截止时间" prop="endTime">
              <el-date-picker
                v-model="yz_content.endTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="担保期限" prop="dbqx">
              <el-input
                v-model="yz_content.dbqx"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="费率" prop="fl">
              <el-input
                v-model="yz_content.fl"
                placeholder="请输入招标人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="反担保保证金" prop="fdbbzj">
              <el-input
                v-model="yz_content.fdbbzj"
                placeholder="请输入担保期限"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保费金额" prop="bfje">
              <el-input
                v-model="yz_content.bfje"
                placeholder="请输入保费金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-form>
        <!-- 农名工工资支付保函 -->
        <el-form
          ref="elForm"
          v-if="nametype == '农民工工资支付保函'"
          :model="nm_content"
          :rules="rules"
          size="medium"
          label-width="100px"
        >
          <el-col :span="12">
            <el-form-item label="保函受益人" prop="syr">
              <el-input
                v-model="nm_content.syr"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函被保证人" prop="bhje">
              <el-input
                v-model="nm_content.bbzr"
                placeholder="请输入项目编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工程项目" prop="gcxm">
              <el-input
                v-model="nm_content.gcxm"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="合同签订日期" prop="htqd">
              <el-date-picker
                v-model="nm_content.qdsj"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="项目地址" prop="jf">
              <el-input
                v-model="nm_content.xmdz"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="建筑面积" prop="htbh">
              <el-input
                v-model="nm_content.jzmj"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工程造价" prop="htbh">
              <el-input
                v-model="nm_content.gczj"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函金额" prop="htbh">
              <el-input
                v-model="nm_content.bhje"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保证金支付的担保标准" prop="htbh">
              <el-input
                v-model="nm_content.xmdzdbbz"
                placeholder="请输入申请人"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工期起始日期" prop="gqStartTime">
              <el-date-picker
                v-model="nm_content.gqStartTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工期结束日期" prop="gqEndTime">
              <el-date-picker
                v-model="nm_content.gqEndTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="竣工后/天" prop="day">
              <el-input
                v-model="nm_content.day"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="费率" prop="dbqx">
              <el-input
                v-model="nm_content.fl"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保费金额" prop="dbqx">
              <el-input
                v-model="nm_content.bfje"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="担保期限" prop="dbqx">
              <el-input
                v-model="nm_content.dbqx"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="反担保保证金" prop="dbqx">
              <el-input
                v-model="nm_content.fdbbzj"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保证期开始时间" prop="bzqStartTime">
              <el-date-picker
                v-model="nm_content.bzqStartTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保证期结束时间" prop="bzqEndTime">
              <el-date-picker
                v-model="nm_content.bzqEndTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-form>
        <!-- 履约保函 -->
        <el-form
          ref="elForm"
          v-if="nametype == '履约保函'"
          :model="ly_content"
          :rules="rules"
          size="medium"
          label-width="100px"
        >
          <el-col :span="12">
            <el-form-item label="保函编号" prop="bhbh">
              <el-input
                v-model="ly_content.bhbh"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函金额" prop="bhje">
              <el-input
                v-model="ly_content.bhje"
                placeholder="保函金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="受益人" prop="syr">
              <el-input
                v-model="ly_content.syr"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="被保证人" prop="bbzr">
              <el-input
                v-model="ly_content.bbzr"
                placeholder="请输入项目编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="项目名称" prop="htbh">
              <el-input
                v-model="ly_content.htbh"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="最高担保金额" prop="jf">
              <el-input
                v-model="ly_content.dbje"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="选择开始时间" prop="gqStartTime">
              <el-date-picker
                v-model="ly_content.startTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择起始日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="选择截止时间" prop="endTime">
              <el-date-picker
                v-model="ly_content.endTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择截止时间"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="担保期限" prop="dbqx">
              <el-input
                v-model="ly_content.dbqx"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="费率" prop="fl">
              <el-input
                v-model="ly_content.fl"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保费金额" prop="bfje">
              <el-input
                v-model="ly_content.bfje"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="反担保保证金" prop="fdbbzj">
              <el-input
                v-model="ly_content.fdbbzj"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-form>
        <!-- 质量保函 -->
        <el-form
          ref="elForm"
          v-if="nametype == '质量保函'"
          :model="zl_content"
          :rules="rules"
          size="medium"
          label-width="100px"
        >
          <el-col :span="12">
            <el-form-item label="保函编号" prop="syr">
              <el-input
                v-model="zl_content.bhje"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保函金额" prop="bhje">
              <el-input
                v-model="zl_content.bhje"
                placeholder="请输入保函金额"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="受益人" prop="syr">
              <el-input
                v-model="zl_content.syr"
                placeholder="请输入保函编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="被保证人" prop="bbzr">
              <el-input
                v-model="zl_content.bbzr"
                placeholder="请输入项目编号"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="合同编号" prop="htbh">
              <el-input
                v-model="zl_content.htbh"
                placeholder="请输入保函金额"
                @focus="tanchuang"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="选择时间" prop="endTime">
              <el-date-picker
                v-model="zl_content.endTime"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                :style="{ width: '100%' }"
                placeholder="请选择截至日期"
                clearable
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="担保期限" prop="dbqx">
              <el-input
                v-model="zl_content.dbqx"
                placeholder="请输入担保期限"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="费率" prop="fl">
              <el-input
                v-model="zl_content.fl"
                placeholder="请输入费率"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="保费金额" prop="bfje">
              <el-input
                v-model="zl_content.bfje"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="反担保保证金" prop="fdbbzj">
              <el-input
                v-model="zl_content.fdbbzj"
                placeholder="请输入起始时间"
                clearable
                :style="{ width: '100%' }"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
    </div>

    <div class="footer">
      <el-button @click="Submittals" style="width: 175px; height: 60px">上一步</el-button>
      <el-button @click="Signature" style="width: 175px; height: 60px" type="primary">下一步</el-button>
    </div>
  </div>
</template>

<script>
import BDhear from "./BDhear.vue";
import { bidfrom } from "@/api/bidfrom";
import axios from "axios";
export default {
  components: {
    BDhear
  },
  props: [],
  statis: false,
  name: "bidFrom",
  data() {
    return {
      //履约保函 {"syr":"123","bbzr":"312312312","htbh":"12312312","dbje":"3123123","bhje":13.44,"endTime":"2022-10-10","dbqx":"12","bfje":1935.3600000000001,"fl":"12","fdbbzj":"123","startTime":"2022-09-28"}
      //投标保函 {"bhje":1477.44,"sqr":"1233","syr":"12312","zbr":"3123","tbr":"123123","xmmc":"1231","xmbh":"23123","bzjje":"123","startTime":"2022-10-28","endTime":"2022-11-09","dbqx":"12","bfje":212751.36,"fl":"12"}
      //业主支付保函 {"yf":"123","jf":"123","htqd":"2022-09-28","htbh":"123123","bhje":12.3,"startTime":"2022-09-28","endTime":"2022-10-10","dbqx":"12","bfje":18172954.800000004,"fl":"123123","fdbbzj":"12","dbje":12.3,"zfje":12.3}
      //农名工工资支付保函 {"syr":"12312","bbzr":"123123","gcxm":"123123","qdsj":"2022-09-28","xmdz":"123123","jzmj":"123123","gczj":"1231231","bhje":283.13,"xmdzdbbz":"123123","gqStartTime":"2022-09-28","gqEndTime":"2022-10-10","day":"123","bzqStartTime":"2022-09-28","bzqEndTime":"2022-10-10","dbqx":"10","bfje":28313,"fl":"10","fdbbzj":""}
      //质量保函 {"syr":"","bbzr":"2312","htbh":"12312","bhje":151.29,"endTime":"2026-01-22","dbqx":"1212","bfje":22576261748.039997,"fl":"123123","fdbbzj":"123123","startTime":"2022-09-28"}
      // 农民工工资支付保函
      // 质量保函
      
      zl_content: {

        syr: "",
        bbzr: "2312",
        htbh: "12312",
        bhje: 151.29,
        endTime: "2026-01-22",
        dbqx: "1212",
        bfje: 22576261748.039997,
        fl: "123123",
        fdbbzj: "123123",
        startTime: "2022-09-28"
      },
      // 履约保函
      ly_content: {
    
        syr: "123",
        bbzr: "312312312",
        htbh: "12312312",
        dbje: "3123123",
        bhje: 13.44,
        endTime: "2022-10-10",
        dbqx: "12",
        bfje: 1935.3600000000001,
        fl: "12",
        fdbbzj: "123",
        startTime: "2022-09-28"
      },
      nm_content: {
        syr: "12312",
        bbzr: "123123",
        gcxm: "123123",
        qdsj: "2022-09-28",
        xmdz: "123123",
        jzmj: "123123",
        gczj: "1231231",
        bhje: 283.13,
        xmdzdbbz: "123123",
        gqStartTime: "2022-09-28",
        gqEndTime: "2022-10-10",
        day: "123",
        bzqStartTime: "2022-09-28",
        bzqEndTime: "2022-10-10",
        dbqx: "10",
        bfje: 28313,
        fl: "10",
        fdbbzj: ""
      },
      // 业主支付保函
      yz_content: {
        yf: "",
        jf: "",
        htqd: "",
        htbh: "",
        bhje: null,
        startTime: "",
        endTime: "",
        dbqx: "",
        bfje: null,
        fl: "",
        fdbbzj: null,
        dbje: null,
        zfje: null
      },
      // 投标保函
      content: {
        bhje: 10,
        sqr: "测试申请人",
        syr: "测试受益人",
        zbr: "测试招标人",
        tbr: "测试投标人",
        xmmc: "测试项目",
        xmbh: "cs0001",
        bzjje: "1",
        startTime: "2022-09-21",
        endTime: "2022-10-01",
        dbqx: "10",
        bfje: 0.1,
        fl: "0.001"
      },
      rules: {
        field102: [
          {
            required: true,
            message: "请输入保函编号",
            trigger: "blur"
          }
        ],
        field110: [
          {
            required: true,
            message: "请输入项目编号",
            trigger: "blur"
          }
        ],
        field103: [
          {
            required: true,
            message: "请输入保函金额",
            trigger: "blur"
          }
        ],
        field111: [
          {
            required: true,
            message: "请输入保证金额",
            trigger: "blur"
          }
        ],
        field124: [
          {
            required: true,
            message: "请输入申请人",
            trigger: "blur"
          }
        ],
        field120: [
          {
            required: true,
            message: "请输入起始时间",
            trigger: "blur"
          }
        ],
        field125: [
          {
            required: true,
            message: "请输入受益人",
            trigger: "blur"
          }
        ],
        field113: [
          {
            required: true,
            message: "请输入截止时间",
            trigger: "blur"
          }
        ],
        field123: [
          {
            required: true,
            message: "请输入招标人",
            trigger: "blur"
          }
        ],
        field114: [
          {
            required: true,
            message: "请输入担保期限",
            trigger: "blur"
          }
        ],
        field115: [
          {
            required: true,
            message: "请输入投标人",
            trigger: "blur"
          }
        ],
        field116: [
          {
            required: true,
            message: "请输入费率",
            trigger: "blur"
          }
        ],
        field121: [
          {
            required: true,
            message: "请输入项目名称",
            trigger: "blur"
          }
        ],
        field122: [
          {
            required: true,
            message: "请输入保费金额",
            trigger: "blur"
          }
        ]
      },
      cion: {
        id: ""
      },
      nametype: ""
    };
  },
  created() {
    this.nametype = sessionStorage.getItem("bhlein");
    this.content.xmbh = sessionStorage.getItem("bidding_number");
    this.content.apply_number = sessionStorage.getItem("apply_number");
    sessionStorage.setItem("apply_number", this.content.apply_number);
    this.content.xmbh = sessionStorage.getItem("bidding_number");
    this.content.xmmc = sessionStorage.getItem("bidding_name");
    this.cion.id = sessionStorage.getItem("guarantee_apply_id");
  },
  methods: {
    tanchuang() {
      console.log(123);
      this.statis = true;
    },
    bidfroms() {
      let Base64 = require('js-base64').Base64; // 引入
      if (this.nametype == "履约保函") {
        var c = Base64.encode(JSON.stringify(this.ly_content));
      }
      if (this.nametype == "投标保函") {
        var c = Base64.encode(JSON.stringify(this.content));
      }
      if (this.nametype == "业主支付保函") {
        var c = Base64.encode(JSON.stringify(this.yz_content));
      }
      if (this.nametype == "农名工工资支付保函") {
        var c = Base64.encode(JSON.stringify(this.nm_content));
      }
      if (this.nametype == "质量保函") {
        var c = Base64.encode(JSON.stringify(this.zl_content));
      }
      //转json
      // var cion = {
      //   guarantee_apply_id: this.cion.id,
      //   content: c,
      //   user_id: sessionStorage.getItem("user_id")
      // };
         var cion = {
        guarantee_apply_id: this.cion.id,
        timecontent: c,
     
      };
   axios({
        url: "http://192.168.0.28:8082/mobile/agent/baohan/bhtime",
        method: "post", // params: '必须是一个无格式对象 query参数',
        data: {
         ...cion
        },
        timeout: 1000,
        headers: {
          token: sessionStorage.getItem("token")
        }
      }).then(res => {
         if (res.data.code == 1) {
          this.$message({
            message: "提交成功请等待审核",
            type: "success"
          });
          this.$router.push("/BidSecurity/ElectronicProtocol");
        } else {
          this.$message.error(res.data.mag);
        }
        // this.$router.push("/BidSecurity/Bidpayment");
      })
          .catch((err) => {
        console.log("失败",err.response.data);
          this.$notify.error({
          message: err.response.data.msg
        });
      });

return
      bidfrom(cion).then(err => {
        console.log("已经提交",err.data.code)
        if (err.data.code == 1) {
          this.$message({
            message: "提交成功请等待审核",
            type: "success"
          });
          this.$router.push("/BidSecurity/ElectronicProtocol");
        } else {
          this.$message.error(err.data.mag);
        }
      });
    },
    Submittals() {
        // this.$router.push("/BidSecurity/Agreement");
      this.$router.push("/BidSecurity/Submission");
    },
    Signature() {
      this.bidfroms();
    }
  }
};
</script>
<style scoped >
.main {
  /* position: absolute; */
  width: 100%;
  padding: 20px;
  height: 600px;
  /* top: 200px; */
  /* right: 0; */
  /* bottom: 0; */
  /* left: 0; */
  margin: auto;
}
.footer {
  position: absolute;
  bottom: 30px;
  left: 39%;
  width: 380px;
  height: 100px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
</style>
